package com.wcll.www;
import java.sql.*;
public class CorporationRegBean {
	private String coruser;
	private String corpass;
	private int areap;
	private int areac;
	private int areat;
	private int contain;
	private String email;
	private String introduce;
	private static Connection con=null;
	public String getCoruser() {
		return coruser;
	}
	public void setCoruser(String coruser) {
		this.coruser = coruser;
	}
	public String getCorpass() {
		return corpass;
	}
	public void setCorpass(String corpass) {
		this.corpass = corpass;
	}
	public int getAreap() {
		return areap;
	}
	public void setAreap(int areap) {
		this.areap = areap;
	}
	public int getAreac() {
		return areac;
	}
	public void setAreac(int areac) {
		this.areac = areac;
	}
	public int getAreat() {
		return areat;
	}
	public void setAreat(int areat) {
		this.areat = areat;
	}
	public int getContain() {
		return contain;
	}
	public void setContain(int contain) {
		this.contain = contain;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public static Connection getCon() throws ClassNotFoundException, SQLException {
		if(con==null){
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost/jobs?useUnicode=true&characterEncoding=UTF8","root","");
		}
		return con;
	}
	public static void setCon(Connection con) {
		CorporationRegBean.con = con;
	}
	public boolean corporationReg(CorporationRegBean crb){
		boolean flags = false;
		try{
			con = CorporationRegBean.getCon();
			Statement st = con.createStatement();
			st.execute("insert into job_corporation values (null,'"+crb.getCoruser()+"','"+crb.getCorpass()+"','"+
					crb.getAreap()+"','"+crb.getAreac()+"','"+crb.getAreat()+"','"+crb.getIntroduce()+"','"+
					crb.getContain()+"','"+crb.getEmail()+"',now())");
			if(st.getUpdateCount()==1){
				flags = true;
			}
		}catch(Exception e){}
		return flags;
	
	}
}
